<?php
namespace Communal\Controller;
use Common\Controller\CommonController;

/**
 * 官网模块
 */
class SiteController extends CommonController {
	private $_media_report;
	protected function _initialize(){
		parent::_initialize();
		
		$this->_media_report = new \Communal\Model\MediaReportModel();
	}
	
	
	/**
	 * 媒体报告列表
	 */
	public function mediaReportListAction(){
		$pageIndex = (int)I('request.pageIndex');
		$pageSize = (int)I('request.pageSize');
		$this->_mediaReportList($pageIndex,$pageSize);
	}
	
	private function _mediaReportList($pageIndex,$pageSize){
		if($pageIndex)$pageIndex--;
		$data['pageIndex'] = $pageIndex;
		$data['pageSize'] = $pageSize;
		$reportList = $this->_media_report->getReportList($data);
		$this->data = $reportList;
		$this->outPut();
	}
	
	/**
	 * 媒体报告详情
	 */
	public function mediaReportDetailAction(){
		$reportid = (int)I('request.reportid');
		$this->_mediaReportDetail($reportid);
	}
	
	private function _mediaReportDetail($reportid){
		$reportInfo = $this->_media_report->getReportById($reportid);
		$this->data = $reportInfo;
		$this->outPut();
	}
}
